<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"  %>
<html>
  <head>
    <title>Demo: Spring Webflow + Tiles2 Ajax</title>
    <script type="text/javascript" src="<c:url value="/resources/dojo/dojo.js" />"> </script>
    <script type="text/javascript" src="<c:url value="/resources/spring/Spring.js" />"> </script>
    <script type="text/javascript" src="<c:url value="/resources/spring/Spring-Dojo.js" />"> </script>
  </head>
<body>
<form:form id="demoForm" commandName="demo" method="POST">

    <div style="margin-top:80px;margin-left:auto;margin-right:auto;width:700px">

        <h2>Basic Spring Webflow + Tiles2 Ajax example:</h2>
        <h2>Instructions:</h2>
        <p>
            Change value non-ajax content field, then click the "Add 1" button.
        </p>
        <p>
            "Ajax Content" should increment, while "Non-ajax Content" should remain the same.
            Also, Observe the contents of the post.
        </p>

        <tiles:insertAttribute name="ajax.content" />

        <input type="submit" id="ajax1" name="_eventId_ajax1" value="Add 1" />
        <script type="text/javascript">
            Spring.addDecoration(new Spring.AjaxEventDecoration({
                elementId:'ajax1',
                event:'onclick',
                formId:'demoForm'}));
        </script>

        <div style="height:0.5em"></div>

        <div>
            Non-ajax Content: <input type="text" id="non-ajax" value="change me"/>
        </div>

        <div style="height:2em"></div>

        <div style="color:gray;">
            <p>Check source code: svn co http://j2eedemos.googlecode.com/svn/trunk/webflow-tiles2</p>
            <p>Note: this demo uses Spring Webflow v2.0.4 and Tiles v2.0.7</p>
        </div>
    </div>

</form:form>
</body>
</html>
